package com.alisoft.nano.seda.test;

import java.util.concurrent.CountDownLatch;

import com.alisoft.nano.seda.Event;
import com.alisoft.nano.seda.notification.StageNotificationListener;

@SuppressWarnings("serial")
public class StageTestListener<T> extends StageNotificationListener<T> {
	private CountDownLatch latch;

	public void setLatch(CountDownLatch latch) {
		this.latch = latch;
	}

	@Override
	protected void onDone(Event<T> event) {
		System.out
				.println("event in " + event.getCurrentStage() + " completed");
		latch.countDown();
	}

}
